<!-- 投递信息页面 -->
<template>
	<view class="page">
		<u-tabs :list="listSwiper" :is-scroll="false" :current="current" @change="change"></u-tabs>
		<swiper class="swiper" :current="current" style="height: calc(100vh - 80rpx - env(safe-area-inset-bottom));"
			@change="chan">
			<!-- 消息已读 -->
			<!-- <swiper-item class="swiper-item" style="height: 100%;">
				<scroll-view class="scroll" scroll-y="true" style="height: 100%;" @scrolltolower="scrollToLower">
					<view class="none" v-if="list.length == 0">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
						<view class="txt">这里空空如也</view>	
					</view>
					<DeliveryList status="0" :item="item" v-for="(item,index) in list" :key="index"></DeliveryList>
				</scroll-view>
			</swiper-item> -->
			<!-- 初筛 -->
			<swiper-item class="swiper-item" style="height: 100%;" >
				<scroll-view class="scroll" scroll-y="true" style="height: 100%;" @scrolltolower="scrollToLower1">
					<view class="none" v-if="list1.length == 0">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
						<view class="txt">这里空空如也</view>	
					</view>
					<DeliveryList status="2" :item="item" v-for="(item,index) in list1" :key="index">
						<template>
							<view class="interview">
								<view class="down flex">
									<view class="icon">
										<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/city.png"
											mode=""></image>
									</view>
									<view class="time" :class="item.positionType==1?'color':''">
										{{item.positionAddress}}
									</view>
								</view>
							</view>
						</template>
						<template slot="right">
							<view class="right flex align-center">
								<!-- <view class="status" :class="item.status==1?'color':''">
									通过
								</view> -->
								<view class="date">
									{{gettimer(item.updateDate)}}
								</view>
							</view>
						</template>
					</DeliveryList>
				</scroll-view>
			</swiper-item>
			<!-- 评估 -->
			<swiper-item class="swiper-item" style="height: 100%;">
				<scroll-view class="scroll" scroll-y="true" style="height: 100%;" @scrolltolower="scrollToLower2">
					<view class="none" v-if="list2.length == 0">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
						<view class="txt">这里空空如也</view>	
					</view>
					<DeliveryList status="3" :item="item" v-for="(item,index) in list2" :key="index">
						<template>
							<view class="interview">
								<view class="down flex">
									<view class="icon">
										<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/city.png"
											mode=""></image>
									</view>
									<view class="time" :class="item.positionType==1?'color':''">
										{{item.positionAddress}}
									</view>
								</view>
							</view>
						</template>
						<template slot="right">
							<view class="right flex align-center">
								<view class="date">
									{{gettimer(item.updateDate)}}
								</view>
							</view>
						</template>
					</DeliveryList>
				</scroll-view>
			</swiper-item>
			<!-- 待面试 -->
			<swiper-item class="swiper-item" style="height: 100%;">
				<scroll-view class="scroll" scroll-y="true" style="height: 100%;" @scrolltolower="scrollToLower0">
					<view class="none" v-if="list0.length == 0">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
						<view class="txt">这里空空如也</view>	
					</view>
					<DeliveryList status="1" :item="item" v-for="(item,index) in list0" :key="index">
						<template>
							<view class="interview">
								<view class="up flex">
									<view class="icon">
										<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/shijian.png"
											mode=""></image>
									</view>
									<view class="time" :class="item.positionType==1?'color':''">
										{{gettimer(item.positionTime)}}
									</view>
								</view>
								<view style="height: 20rpx;">
			
								</view>
								<view class="down flex">
									<view class="icon">
										<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/city.png"
											mode=""></image>
									</view>
									<view class="time" :class="item.positionType==1?'color':''">
										{{item.positionAddress}}
									</view>
								</view>
							</view>
						</template>
						<template slot="right">
							<view class="right" :class="item.positionType==1?'color':''">
								{{gettimer(item.updateDate)}}
							</view>
						</template>
					</DeliveryList>
				</scroll-view>
			</swiper-item>
			<!-- 未通过 -->
			<swiper-item class="swiper-item" style="height: 100%;">
				<scroll-view class="scroll" scroll-y="true" style="height: 100%;" @scrolltolower="scrollToLower4">
					<view class="none" v-if="list4.length == 0">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
						<view class="txt">这里空空如也</view>	
					</view>
					<DeliveryList status="3" :item="item" v-for="(item,index) in list4" :key="index">
						<template>
							<view class="interview">
								<view class="down flex">
									<view class="icon">
										<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/city.png"
											mode=""></image>
									</view>
									<view class="time" :class="item.positionType==1?'color':''">
										{{item.positionAddress}}
									</view>
								</view>
							</view>
						</template>
						<template slot="right">
							<view class="right flex align-center">
								<view class="date">
									{{gettimer(item.updateDate)}}
								</view>
							</view>
						</template>
					</DeliveryList>
				</scroll-view>
			</swiper-item>
			<!-- offer -->
			<swiper-item class="swiper-item" style="height: 100%;">
				<scroll-view class="scroll" scroll-y="true" style="height: 100%;"  @scrolltolower="scrollToLower3">
					<view class="none" v-if="list3.length == 0">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
						<view class="txt">这里空空如也</view>	
					</view>
					<DeliveryList status="4" :item="item" v-for="(item,index) in list3" :key="index">
						<template>
							<view class="interview">
								<view class="up flex">
									<view class="imgs">
										<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/youjian.png"
											mode=""></image>
									</view>
									<view class="time" :class="item.positionType==1?'color':''">
										<view style="margin-bottom: 20rpx;">
											{{item.actualName}}：你收到一封来自{{item.companyName}}公司的入职offer
										</view>
										<view class="flex align-center">
											<!-- <view class="">
												查看详情
											</view> -->
											<view class="img flex justify-center align-center">
												<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/youlink.png" mode=""></image>
											</view>
										</view>
									</view>
								</view>
							</view>
						</template>
						<template slot="right">
							<view class="right" :class="item.positionType==1?'color':''">
								{{gettimer(item.updateDate)}}
							</view>
						</template>
					</DeliveryList>
				</scroll-view>
			</swiper-item>
			<!-- 入职 -->
			<swiper-item class="swiper-item" style="height: 100%;">
				<scroll-view class="scroll" scroll-y="true" style="height: 100%;" @scrolltolower="scrollToLower5">
					<view class="none" v-if="list5.length == 0">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
						<view class="txt">这里空空如也</view>	
					</view>
					<DeliveryList status="3" :item="item" v-for="(item,index) in list5" :key="index">
						<template>
							<view class="interview">
								<view class="down flex">
									<view class="icon">
										<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/city.png"
											mode=""></image>
									</view>
									<view class="time" :class="item.positionType==1?'color':''">
										{{item.positionAddress}}
									</view>
								</view>
							</view>
						</template>
						<template slot="right">
							<view class="right flex align-center">
								<view class="date">
									{{gettimer(item.updateDate)}}
								</view>
							</view>
						</template>
					</DeliveryList>
				</scroll-view>
			</swiper-item>
			<!-- 未入职 -->
			<swiper-item class="swiper-item" style="height: 100%;">
				<scroll-view class="scroll" scroll-y="true" style="height: 100%;" @scrolltolower="scrollToLower6">
					<view class="none" v-if="list6.length == 0">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
						<view class="txt">这里空空如也</view>	
					</view>
					<DeliveryList status="3" :item="item" v-for="(item,index) in list6" :key="index">
						<template>
							<view class="interview">
								<view class="down flex">
									<view class="icon">
										<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/test/city.png"
											mode=""></image>
									</view>
									<view class="time" :class="item.positionType==1?'color':''">
										{{item.positionAddress}}
									</view>
								</view>
							</view>
						</template>
						<template slot="right">
							<view class="right flex align-center">
								<view class="date">
									{{gettimer(item.updateDate)}}
								</view>
							</view>
						</template>
					</DeliveryList>
				</scroll-view>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import DeliveryList from '@/components/deliveryList/deliveryList.vue'
	export default {
		components: {
			DeliveryList
		},
		data() {
			return {
				listSwiper: [
				// {
				// 	name: '消息已读'
				// },
				{
					name: '初筛'
				}, {
					name: '评估中'
				}, {
					name: '待面试'
				}, {
					name: '未通过'
				},  {
					name: 'offer'
				},{
					name: '入职'
				}, {
					name: '未入职'
				}, ],
				current: 0,
				list:[],
				list0:[],
				list1:[],
				list2:[],
				list3:[],
				list4:[],
				list5:[],
				list6:[],
				messageQurey: {
					type: 10,
					pageNum: 1,
					pageSize: 10
				},
				jobQurey: {
					type: 5,
					pageNum: 1,
					pageSize: 10
				},
				enJobQurey: {
					type: 6,
					pageNum: 1,
					pageSize: 10
				},
				waitQurey: {
					type: 0,
					pageNum: 1,
					pageSize: 10
				},
				unSelectQurey:{
					type: 4,
					pageNum: 1,
					pageSize: 10
				},
				firstQurey: {
					type: 1,
					pageNum: 1,
					pageSize: 10
				},
				secondQurey: {
					type: 2,
					pageNum: 1,
					pageSize: 10
				},
				offerQurey: {
					type: 3,
					pageNum: 1,
					pageSize: 10
				}
			}
		},
		onLoad(e) {
			this.message()
			this.wait()
			this.first()
			this.second()
			this.offer()
			this.unSelect()
			this.job()
			this.enJob()
			this.current = e.current
		},
		watch:{
			
		},
		methods: {
			//tabs标签切换事件
			change(e) {
				this.current = e
			},
			//swiper滑动
			chan(e) {
				this.current = e.detail.current
			},
			//请求 消息已读
			async message() {
				let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.messageQurey)
				this.list = this.list.concat(list.body) 
			},
			scrollToLower(){
				this.messageQurey.pageNum++
				this.message()
			},
			//请求 待面试
			async wait() {
				let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.waitQurey)
				this.list0 = this.list0.concat(list.body) 
				console.log(this.list0)
			},
			async unSelect() {
				let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.unSelectQurey)
				this.list4 = this.list4.concat(list.body) 
				console.log(list)
			},
			scrollToLower4(){
				this.unSelectQurey.pageNum++
				this.unSelect()
			},
			async second() {
				let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.secondQurey)
				this.list2 = this.list2.concat(list.body) 
				console.log(list)
			},
			scrollToLower2(){
				this.secondQurey.pageNum++
				this.second()
			},
			scrollToLower0(){
				this.waitQurey.pageNum++
				this.wait()
			},
			//请求 初筛
			async first() {
				let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.firstQurey)
				this.list1 =this.list1.concat(list.body) 
			},
			scrollToLower1(){
				this.firstQurey.pageNum++
				this.first()
			},
			//请求 过筛
			// async second() {
			// 	let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.secondQurey)
			// 	this.list3 = list.body
			// },
			//请求 offer
			async offer() {
				let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.offerQurey)
				this.list3 = this.list3.concat(list.body)
			},
			async job() {
				let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.jobQurey)
				this.list5 = this.list5.concat(list.body)
			},
			scrollToLower5(){
				this.jobQurey.pageNum++
				this.job()
			},
			async enJob() {
				let {data: list} = await this.$get('/userResumeList/ResumeLogPage',this.enJobQurey)
				this.list6 = this.list6.concat(list.body)
			},
			scrollToLower6(){
				this.enJobQurey.pageNum++
				this.enJob()
			},
			scrollToLower3(){
				this.offerQurey.pageNum++
				this.offer()
			},
			//转换时间戳格式
			gettimer(i){
				let oldtime = new Date(i);
				let t_day = oldtime.getDate();
				let t_year = oldtime.getFullYear();
				let t_month = oldtime.getMonth() + 1;
				let t_hour = oldtime.getHours();
				let t_minute = oldtime.getMinutes();
				if(t_hour <= 9){
					t_hour = '0' + t_hour
				}
				if(t_minute <= 0){
					t_minute = '0' + t_minute
				}
				return t_year + '年' + t_month + '月' + t_day + '日' +t_hour + ':' + t_minute
			},
		}
	}
</script>

<style lang="scss">
	.page {
		.swiper {
			.swiper-item {
				.scroll {
					.none{
						position: absolute;
						left:50%;
						top:50%;
						transform: translate(-57%,-50%);
						image{
							width: 250rpx;
							height: 250rpx;
						}
						.txt{
							padding-top: 40rpx;
							color: #999999;
							font-size: 24rpx;
							display: flex;
							justify-content: center;
						}
					}
					.right {
						font-weight: 500;
						color: #999999;
						font-size: 24rpx;

						.status {
							font-weight: 500;
							color: #FD6001;
							font-size: 24rpx;
							margin-right: 22rpx;
						}

						.date {}
					}

					.interview {
						font-weight: 500;
						color: #777777;
						font-size: 24rpx;
						margin-bottom: 30rpx;

						.up {

							.icon {
								width: 24rpx;
								height: 24rpx;
								margin-right: 16rpx;
							}

							.imgs {
								width: 31rpx;
								height: 24rpx;
								margin-right: 16rpx;
							}
							.time {
								.img{
									width: 12rpx;
									height: 22rpx;
									margin-left: 20rpx;
								}
							}
						}

						.down {
							.icon {
								width: 24rpx;
								height: 27rpx;
								margin-right: 16rpx;
							}

							.time {}
						}
					}
				}
			}
		}

		.color {
			color: #999999 !important;
		}
	}
</style>
